package com.sxhuayuan.parking.service;

import com.sxhuayuan.parking.compenent.Page;
import com.sxhuayuan.parking.compenent.Pageable;
import com.sxhuayuan.parking.entity.*;

import java.util.List;

public interface ParkChannelService extends BaseService<ParkChannel, Long> {

	/** 根据车场 出口查询 */
	ParkChannel findBySn(String sn);

	/**
	 * 查询车场的设备所在车道
	 * 
	 * @param lotId
	 * @param deviceId
	 * @return
	 */
	ParkChannel findByDevice(Long lotId, String deviceId);

	/**
	 *
	 * @param lotId
	 * @param channelOutSn
	 * @return
	 */
	ParkChannel findByChannelSn(Long lotId, String channelOutSn);

	/**
	 * 出口分页查询
	 * 
	 * @param agent
	 */
	Page<ParkChannel> findPage(Pageable pageable, ParkChannel.Type type, Agent agent);

	/** 根据车场查询出口数量 */
	Long countByParkingLot(ParkingLotUser parkingLotUser, ParkChannel.Type type);

	/** 根据车场用户查询出口分页 */
	Page<ParkChannel> findPageByParkingLotUser(Pageable pageable, ParkingLotUser parkingLotUser);

	/** 根据车场、通道类型、通道名称查询 */
	ParkChannel findByParkingLotAndTypeAndName(ParkingLot parkingLot,ParkChannel.Type type,String name);

	/** 更具车厂编号,车道类型查询 */
	List<ParkChannel> findByParkingLotIdAndType(Long lotId, ParkChannel.Type type);
}
